//
//  SpecialDetailTableViewCell2.m
//  味·道
//
//  Created by lizi on 15/7/1.
//  Copyright (c) 2015年 WMR. All rights reserved.
//

#import "SpecialDetailTableViewCell2.h"
#import <UIImageView+WebCache.h>
#define pic_Width 80
#define pic_Height 70

@implementation SpecialDetailTableViewCell2
- (void)dealloc
{
    [_picView release];
    [_titleLable release];
    [_ageLable release];
    [_categoryLable release];
    [_effectLable release];
    [super dealloc];
}
-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self p_setupSubviews];
    }
    return self;
}
- (void)p_setupSubviews{
    _picView = [[UIImageView alloc] initWithFrame:CGRectMake(10, 10, pic_Width, pic_Height)];
    [self.contentView addSubview:_picView];
    [_picView release];
    _titleLable = [[UILabel alloc] initWithFrame:CGRectMake(pic_Width+20, 0, 250, 30)];
    _titleLable.textColor = [UIColor greenColor];
    [self.contentView addSubview:_titleLable];
    [_titleLable release];
    _categoryLable = [[UILabel alloc] initWithFrame:CGRectMake(pic_Width+20, 35, 250, 7)];
    _categoryLable.font = [UIFont systemFontOfSize:15];
    _categoryLable.textColor = [UIColor grayColor];
    [self.contentView addSubview:_categoryLable];
    [_categoryLable release];
    _ageLable = [[UILabel alloc] initWithFrame:CGRectMake(pic_Width+20, 55, 250, 7)];
    _ageLable.font = [UIFont systemFontOfSize:15];
    _ageLable.textColor = [UIColor grayColor];
    [self.contentView addSubview:_ageLable];
    [_ageLable release];
    _effectLable = [[UILabel alloc] initWithFrame:CGRectMake(pic_Width+20, 75, 250, 7)];
    _effectLable.font = [UIFont systemFontOfSize:15];
    _effectLable.textColor = [UIColor grayColor];
    [self.contentView addSubview:_effectLable];
    [_effectLable release];
}
-(void)setDetailModel:(SpecialDetailModel *)detailModel{
    if (_detailModel != detailModel) {
        [_detailModel release];
        _detailModel = [detailModel retain];
    }
    [_picView sd_setImageWithURL:[NSURL URLWithString:detailModel.thumb]placeholderImage:[UIImage imageNamed:@"defaultImage"]];
    _titleLable.text = detailModel.title;
    _categoryLable.text = detailModel.category;
    _ageLable.text = detailModel.age;
    _effectLable.text = detailModel.effect;
}
- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
